package com.neuedu.his.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.neuedu.his.entity.PatientCosts;
import com.neuedu.his.service.PatientCostsService;

@RestController
@RequestMapping("/patientcosts")
public class PatientCostsController {

	@Autowired
	private PatientCostsService service;
	
	@RequestMapping("/selectAll")
//  http://localhost:8088/patientcosts/selectAll?registid=35&invoiceid=134
	public List<PatientCosts> selectAll(PatientCosts u){
		return service.selectAll(u);
	}
	
	@RequestMapping("/selectById")
//  http://localhost:8088/patientcosts/selectById?registid=35
	public List<PatientCosts> selectById(PatientCosts u){
		return service.selectById(u);
	}
	
	@RequestMapping("/add")
//  http://localhost:8088/patientcosts/add?registid=1&invoiceid=1&itemid=1&itemtype=1&name=1&price=1&amount=1&deptid=1&createtime=2021-01-01 09:00:00&createoperid=1&paytime=2021-01-01 09:00:00&registerid=1&feetype=1
	public int add(PatientCosts u){
		return service.add(u);
	}
	
	@RequestMapping("/update")
//  http://localhost:8088/patientcosts/update?invoiceid=2&id=274
	public int update(PatientCosts u){
		return service.update(u);
	}
	
	@RequestMapping("/delete")
//  http://localhost:8088/patientcosts/delete?id=274
	public int delete(PatientCosts u){
		return service.delete(u);
	}
}
